/**
 * Copyright 2009 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.code.sapien.dao;

import java.util.List;

import com.google.code.sapien.dao.jpa.DiscussionJpaDAO;
import com.google.code.sapien.model.Discussion;
import com.google.inject.ImplementedBy;

/**
 * Interface for Discussion Data Access Objects.
 * @author Adam
 * @version $Id: DiscussionDAO.java 24 2009-05-15 04:38:19Z a.ruggles $
 * 
 * Created on Feb 9, 2009 at 10:16:23 PM 
 */
@ImplementedBy(DiscussionJpaDAO.class)
public interface DiscussionDAO extends EntityDAO<Discussion> {
	/**
	 * Returns the total number of discussions.
	 * @return The total number of discussions.
	 */
	int getCount();

	/**
	 * Returns the total number of discussions under a given category.
	 * @param categoryId The category id.
	 * @return The total number of discussions under a given category.
	 */
	int getCount(final Long categoryId);

	/**
	 * Returns discussions, ordered by modified date in descending order.
	 * @param offset The offset in the results set for the first discussion to return.
	 * @param maxResults The maximum number of results to return.
	 * @return A list of discussions.
	 */
	List<Discussion> list(int offset, int maxResults);

	/**
	 * Returns discussions, order by modified date in descending order under a given category.
	 * @param categoryId The category id.
	 * @param offset The offset in the results set for the first discussion to return.
	 * @param maxResults The maximum number of results to return.
	 * @return  A list of discussions.
	 */
	List<Discussion> list(Long categoryId, int offset, int maxResults);
}
